package com.itheima.zhuanhuan;

import java.io.*;
import java.nio.charset.Charset;

public class Demo01 {
/*
使用转换流 可以读取 非默认编码集的 文档
可以指定编码集
 */
    public static void main(String[] args) throws IOException {
        //FileReader reader = new FileReader("day13\\aaa\\a.txt");
        //FileReader reader = new FileReader("day13\\aaa\\a.txt", Charset.forName("gbk"));
        //BufferedReader reader = new BufferedReader(new FileReader("day13\\\\aaa\\\\a.txt"));
        //InputStreamReader reader = new InputStreamReader(new FileInputStream("day13\\aaa\\a.txt"), Charset.forName("gbk"));
        //InputStreamReader reader = new InputStreamReader(new FileInputStream("day13\\aaa\\a.txt"), "gbk");
        BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("day13\\aaa\\a.txt"), "gbk"));

        int ch;
        while ((ch = reader.read()) != -1) {
            System.out.println((char) ch);
        }
        reader.close();


    }
}
